<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>登录/注册选择</title>
  <link rel="stylesheet" href="../css/Login.css">
  <script src="../js/Login.js"></script>
</head>

<body>

  <div class="container">
    <div class="tab-buttons">
      <button class="tab-button active" onclick="showTab('register')">新用户注册</button>
      <button class="tab-button" onclick="showTab('login')">已有用户登录</button>
      <button class="tab-button" onclick="showTab('manager-login')">管理员登录</button>
    </div>

    <div id="register" class="tab-content active">
      <!-- 注册表单 -->
      <form action="/submit-register" method="post" onsubmit="event.preventDefault(); goToPage()">
        <div class="input-row">
          <input type="text" name="name" placeholder="姓名" required>
          <input type="text" name="age" placeholder="年龄">
        </div>
        <div class="input-row">
          <div class="gender-select">
            <select name="gender" required>
              <option value="1">男</option>
              <option value="0">女</option>
            </select>
          </div>
          <input type="text" name="college" placeholder="学院" required>
          <input type="text" name="grade" placeholder="年级" required>
        </div>

        <div class="input-row">
          <input type="text" name="major" placeholder="专业" required>
          <input type="text" name="className" placeholder="班级" required>
        </div>
        <div class="input-row">
          <input type="text" name="address" placeholder="家庭地址" required>
        </div>
        <div class="input-row">
          <input type="text" name="phone" placeholder="手机号" required>
        </div>
        <div class="input-row">
          <input type="password" name="password" placeholder="密码" required>
        </div>
        <input type="submit" value="注册" class="register">
      </form>
    </div>

    <div id="login" class="tab-content">
      <!-- 用户登录表单 -->
      <form action="/submit-login" method="post" onsubmit="event.preventDefault(); userLogin()">
        <input type="text" name="phone" class="phone_input" placeholder="手机号" required>
        <input type="password" name="password" class="password_input" placeholder="密码" required>
        <input type="submit" class="submit_input" value="登录">
      </form>
    </div>
    <div id="manager-login" class="tab-content">
      <!-- 管理员登陆表单 -->
      <form action="/submit-manager-login" method="post" onsubmit="event.preventDefault(); adminLogin()">
        <input type="text" name="phone" placeholder="手机号" required>
        <input type="password" name="password" placeholder="密码" required>
        <input type="submit" value="登录">
      </form>
    </div>
    <span class="agree-policy-wrapper">
      <input type="checkbox" class="agree-policy-wrapper" required>
      已阅读并同意
      <a href="#">《用户协议》</a>
      <a href="#">《隐私政策》</a>,
      允许统一管理本人账号信息
    </span>
  </div>

</body>

</html>